﻿using System;
using System.Runtime.CompilerServices;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using LiveCharts;
using LiveCharts.Charts;
using LiveCharts.Definitions.Points;
using LiveCharts.Dtos;
using LiveCharts.Wpf;
using LiveCharts.Wpf.Points;

internal class Class8 : PointView, IOhlcPointView, IChartPointView
{
	[CompilerGenerated]
	public Class4 method_0()
	{
		return this.class4_0;
	}

	[CompilerGenerated]
	public void method_1(Class4 class4_1)
	{
		this.class4_0 = class4_1;
	}

 
	public double Open { get; set; }

 
	public double High { get; set; }

 
	public double Close { get; set; }

 
	public double Low { get; set; }
 
	public double Width { get; set; }
 
	public double Left { get; set; }

 
	public double StartReference { get; set; }

	public override void DrawOrMove(ChartPoint previousDrawn, ChartPoint current, int index, ChartCore chart)
	{
		base.ValidArea = new CoreRectangle(this.Left, this.High, this.Width, Math.Abs(this.High - this.Low));
		if (base.IsNew)
		{
			this.method_0().method_3(this.StartReference);
			this.method_0().method_1(this.StartReference);
			this.method_0().method_5(this.StartReference);
			this.method_0().method_7(this.StartReference);
			this.method_0().method_11(this.Left);
			this.method_0().method_9(this.Width);
			this.method_0().method_13(false, TimeSpan.Zero);
			this.pathGeometry_0 = new PathGeometry[]
			{
				(PathGeometry)((GOhlcSeries)current.SeriesView).AltShapesStroke.Path_0.Data,
				(PathGeometry)((GOhlcSeries)current.SeriesView).ShapesStroke.Path_0.Data
			};
			if (base.DataLabel != null)
			{
				Canvas.SetTop(base.DataLabel, current.ChartLocation.Y);
				Canvas.SetLeft(base.DataLabel, current.ChartLocation.X);
			}
			if (this.Open <= this.Close)
			{
				foreach (PathFigure value in this.method_0().method_12())
				{
					this.pathGeometry_0[0].Figures.Add(value);
				}
			}
			else
			{
				foreach (PathFigure value2 in this.method_0().method_12())
				{
					this.pathGeometry_0[1].Figures.Add(value2);
				}
			}
			this.bool_0 = (this.Open <= this.Close);
		}
		this.method_0().method_9(this.Width);
		this.method_0().method_11(this.Left);
		this.method_0().method_1(this.Open);
		this.method_0().method_3(this.High);
		this.method_0().method_5(this.Close);
		this.method_0().method_7(this.Low);
		if (this.bool_0 != this.Open <= this.Close)
		{
			if (this.Open <= this.Close)
			{
				foreach (PathFigure value3 in this.method_0().method_12())
				{
					this.pathGeometry_0[0].Figures.Remove(value3);
					this.pathGeometry_0[1].Figures.Remove(value3);
					this.pathGeometry_0[0].Figures.Add(value3);
				}
			}
			else
			{
				foreach (PathFigure value4 in this.method_0().method_12())
				{
					this.pathGeometry_0[0].Figures.Remove(value4);
					this.pathGeometry_0[1].Figures.Remove(value4);
					this.pathGeometry_0[1].Figures.Add(value4);
				}
			}
			this.bool_0 = (this.Open <= this.Close);
		}
		if (chart.View.DisableAnimations)
		{
			this.method_0().method_13(false, TimeSpan.Zero);
			if (base.DataLabel != null)
			{
				base.DataLabel.UpdateLayout();
				double length = this.method_2(current.ChartLocation.X - base.DataLabel.ActualHeight * 0.5, chart);
				double length2 = this.method_3(current.ChartLocation.Y - base.DataLabel.ActualWidth * 0.5, chart);
				Canvas.SetTop(base.DataLabel, length2);
				Canvas.SetLeft(base.DataLabel, length);
			}
			return;
		}
		TimeSpan animationsSpeed = chart.View.AnimationsSpeed;
		if (base.DataLabel != null)
		{
			base.DataLabel.UpdateLayout();
			double toValue = this.method_2(current.ChartLocation.X - base.DataLabel.ActualWidth * 0.5, chart);
			double toValue2 = this.method_3(current.ChartLocation.Y - base.DataLabel.ActualHeight * 0.5, chart);
			base.DataLabel.BeginAnimation(Canvas.LeftProperty, new DoubleAnimation(toValue, animationsSpeed));
			base.DataLabel.BeginAnimation(Canvas.TopProperty, new DoubleAnimation(toValue2, animationsSpeed));
		}
		this.method_0().method_13(true, animationsSpeed);
	}

	public override void RemoveFromView(ChartCore chart)
	{
		foreach (PathFigure value in this.method_0().method_12())
		{
			PathGeometry[] array2 = this.pathGeometry_0;
			for (int j = 0; j < array2.Length; j++)
			{
				array2[j].Figures.Remove(value);
			}
		}
		chart.View.RemoveFromDrawMargin(base.DataLabel);
	}

	protected double method_2(double double_7, ChartCore chartCore_0)
	{
		if (double_7 + base.DataLabel.ActualWidth * 0.5 < -0.1)
		{
			return -base.DataLabel.ActualWidth;
		}
		if (double_7 + base.DataLabel.ActualWidth > chartCore_0.DrawMargin.Width)
		{
			double_7 -= double_7 + base.DataLabel.ActualWidth - chartCore_0.DrawMargin.Width + 2.0;
		}
		if (double_7 < 0.0)
		{
			double_7 = 0.0;
		}
		return double_7;
	}

	protected double method_3(double double_7, ChartCore chartCore_0)
	{
		if (double_7 + base.DataLabel.ActualHeight > chartCore_0.DrawMargin.Height)
		{
			double_7 -= double_7 + base.DataLabel.ActualHeight - chartCore_0.DrawMargin.Height + 2.0;
		}
		if (double_7 < 0.0)
		{
			double_7 = 0.0;
		}
		return double_7;
	}

	private PathGeometry[] pathGeometry_0;

	[CompilerGenerated]
	private Class4 class4_0;

	[CompilerGenerated]
	private double double_0;

	[CompilerGenerated]
	private double double_1;

	[CompilerGenerated]
	private double double_2;

	[CompilerGenerated]
	private double double_3;

	[CompilerGenerated]
	private double double_4;

	[CompilerGenerated]
	private double double_5;

	[CompilerGenerated]
	private double double_6;

	private bool bool_0;
}
